home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / PRGMMING / PWORD_MC.ZIP / WAIT.CPP < prev   
Encoding:
C/C++ Source or Header  |  1994-12-04  |  619 b   |  30 lines

  1. // Wait for next round of user input
  2. // if password attempt fails.
  3. // Michael J. Campbell
  4.  
  5. #include <dos.h>
  6. #include <stdio.h>
  7. #include <graphics.h>
  8.  
  9. void wait(void)
  10.     {
  11.     char wait[50];
  12.  
  13.     // Draw timer box
  14.     setfillstyle(SOLID_FILL,LIGHTGRAY);
  15.     bar(203,203,437,287);
  16.     settextstyle(SMALL_FONT,HORIZ_DIR,4);
  17.     settextjustify(CENTER_TEXT,CENTER_TEXT);
  18.     setcolor(BLACK);
  19.  
  20.     // Timer loop, archaic but it works ok
  21.     for(int count = 45; count >= 0; count--)
  22.         {
  23.  
  24.         sprintf(wait,"Try Again In: %02d Seconds",count);
  25.         outtextxy(320,245,wait);
  26.         delay(1000);
  27.         bar(203,230,437,260); // Clear box
  28.  
  29.         }
  30.     }